package com.xiangge.zuoye2;

import java.util.Arrays;
import java.util.Random;

public class Demo8 {

    public static void main(String[] args) {
        int[] arr = new int[10];
        for (int i = 0; i < arr.length; i++) {
            arr[i] = new Random().nextInt(100) + 1;
        }
        int[] brr = new int[arr.length];
        int ji = 0;
        int ou = arr.length-1;
        for (int i = 0; i < arr.length; i++) {
            if (arr[i]%2!=0){
                brr[ji] = arr[i];
                ji++;
            }else {
                brr[ou]=arr[i];
                ou--;
            }
        }
        System.out.println(Arrays.toString(brr));

    }
}
